1. Field of the Invention
The present invention relates to an encoding device for encoding data, and a method therefor.
2. Related Background Art
As a reversible encoding method, there is conventionally known DPCM+entropy encoding which is the internationally standardized JPEG method.
This method consists of calculating a predicted value for an encoding target pixel, utilizing pixels therearound, then generating difference data between the predicted value and the actual pixel value of the encoding target pixel, and effecting variable-length encoding such as Huffman encoding on the difference data.
FIG. 3A shows an example of the predicting method for generating the above-mentioned predicted value.
There are illustrated a target pixel X, and surrounding pixels a, b, c used for prediction. There are provided 7 equations for generating the difference between the predicted value and the target pixel X, and one of the equations is suitably selected.
Also among the blockwise difference encoding methods, there is known a method for encoding the difference data between an encoding target block and a reference block obtained from the already encoded area.
In case of selecting an efficient encoding method from plural difference encoding methods by predicting the encoding efficiency, the efficiency has conventionally been compared by the code length of the difference data, but, in the blockwise difference encoding methods, the code length may eventually become longer since other data (such as vector information in the embodiments of the present invention) have to be added in a larger amount, in comparison with the encoding methods utilizing the correlation of nearby pixels.
Also in case of selecting an efficient encoding method from plural difference encoding methods by predicting the encoding efficiency in succession, there is required a long time for such prediction because other encoding methods have to still be evaluated even if an encoding method satisfying the required encoding efficiency is identified in the course of such prediction.
Also in the conventional DPCM encoding mentioned above, since only one prediction mode (method of difference generation utilizing the target pixel X and the nearby pixels a, b, c) can be selected for each image, the encoding efficiency cannot be improved if the character of the image varies locally within the image.
Also there is only utilized the correlation between the encoding target pixel and the nearby pixels, the correlation with other pixels cannot be utilized.
Also in the blockwise difference encoding methods, the reference block can only be selected from the already encoded area, and there cannot be utilized even the correlation with the nearby pixels.
Furthermore, in the blockwise difference encoding methods mentioned above, even if the reference block and the encoding target block are similar in the frequency characteristics, the encoding efficiency cannot be improved if these blocks are generally different in luminosity or in density.
Furthermore, the adaptive Huffman encoding or the dynamic arithmetic encoding is utilized for the conventional variable-length encoding mentioned above, but these encoding methods have been associated with the following drawbacks: (i) In Huffman encoding, in which a code is assigned to a difference data, the shortest code for a pixel cannot be less than 1 bit; (ii) Also in case the difference between the most frequently appearing difference data and the next most frequently appearing difference data is small, the code for a pixel becomes two bits or longer; (iii) On the other hand, the arithmetic encoding, being capable of encoding without partition in the difference data, can dispense with the above-mentioned fixed bit length for each difference data; (iv) However, in case of applying the arithmetic encoding to the encoding of multi-value data, the difference data are encoded bit by bit, and the statistical model of conditions for such bit encoding is difficult to prepare; and (v) Also the number of levels of such multi-value data is large, the encoding efficiency cannot be better in comparison with that of the Huffman encoding.
Also in case plural encoding methods are simultaneously employed within an image, there is required positional information indicating the image area in which each encoding method is used, but such information has to be prepared separately from the difference data encoded by such plural encoding methods, so that the entire data amount after encoding becomes inevitably large.